import {baseUrl} from "@/config/env";

export default () => {
    return {
        index: true,
        submitText: '修改',
        size: 'default',
        labelWidth: 120,
        dialogType: 'drawer',
        menuAlign: 'center',
        menuPosition: "right",
        searchIndex: 2,
        searchMenuSpan: 6,
        addBtn: true,
        editBtn: true,
        delBtn: true,
        searchIcon: true,
        permissionBtn: {
            addBtn: 'start:dataSource:add',
            editBtn: 'start:dataSource:edit',
            viewBtn: 'start:dataSource:info',
            delBtn: 'start:dataSource:delete'
        },
        column: [
            {
                label: '数据源名称',
                span: 24,
                prop: 'name',
                rules: [{
                    required: true,
                    trigger: "blur"
                }]
            },
            {
                label: '数据库类型',
                span: 12,
                type: "select",
                prop: 'driverClassName',
                dicUrl: baseUrl + "/start/sysDictionaryItem/listByDictionaryCode",
                dicMethod: "get",
                dicQuery: {dictCode: "data_base_driver_class_name"},
                props: {
                    label: 'dictName',
                    value: 'dictVal',
                },
            },
            {
                label: '数据源标记',
                span: 12,
                prop: 'keyFlag',
                rules: [{
                    required: true,
                    trigger: "blur"
                }]
            }, {
                label: '用户名',

                span: 12,
                prop: 'userName',

            }, {
                label: '密码',
                span: 12,
                prop: 'pwd',
                type: 'password'
            }, {
                label: '数据源地址',
                span: 24,
                prop: 'url',
                type: 'textarea',
                maxlength: 500,
                hide: true,
                showWordLimit: true,
                slot: true,
                rules: [{
                    required: true,
                    trigger: "blur"
                }]
            },
            {
                label: '是否系统',
                prop: 'isSystem',
                type: 'radio',
                button: true,
                editDisabled: true,
                rules: [{
                    required: true,
                    trigger: "blur"
                }],
                dicData: [
                    {label: '否', value: 0},
                    {label: '是', value: 1},
                ],
                span: 12,
            },

        ]
    }
}
